﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary
{
    /// <summary>
    /// This class represents a lower triangular matrix.
    /// </summary>
    [Serializable]
    public class LowerTriangularMatrix : SquareMatrix
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="LowerTriangularMatrix"/> class.
        /// </summary>
        /// <param name="dimension">The dimension of the triangular matrix.</param>
        public LowerTriangularMatrix(int dimension) 
          : base(dimension)
      {
      }

        /// <summary>
        /// Initializes a new instance of the <see cref="LowerTriangularMatrix"/> class.
        /// </summary>
        /// <param name="matrix">The matrix values of the square matrix. The number of rows and columns have to be even.</param>
      public LowerTriangularMatrix(double[,] matrix) 
          : base(matrix)
      {
      }

      /// <summary>
      /// Initializes a new instance of the <see cref="LowerTriangularMatrix"/> class.
      /// </summary>
      /// <param name="matrix">The matrix to clone. The number of rows and columns have to be even.</param>
      public LowerTriangularMatrix(Matrix matrix) 
          : base(matrix)
      {
          if (!this.IsSquareMatrix)
          {
              throw new ArgumentException("The number of rows and columns have to be even.");
          }
      }
    }
}
